{extend name="base" /}
{block name="body"}
<div class="layui-card">
    <div class="layui-card-header">编辑数据</div>
    <div class="layui-card-body">
        <form action="{:request()->url()}" class="layui-form" method="post">
            <div class="layui-form-item">
                <input type="hidden" name="personnel_id" value="{$data.personnel_id|default=''}">
                <label class="layui-form-label">* 姓名</label>
                <div class="layui-input-inline">
                    <input type="text" name="name" value="{$data.name|default=''}" autocomplete="off" placeholder="请输入用户名" lay-verify="required|name" class="layui-input">
                </div>
                <div class="layui-form-mid layui-word-aux">用户名不能有特殊字符，首尾不能出现下划线，不能全为数字</div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">* 性别</label>
                <div class="layui-input-inline">
                    <input type="radio" name="sex" {if condition="isset($data) and $data.sex eq 1"} checked="checked" {/if} value="1" >男<input type="radio" name="sex" {if condition="isset($data) and $data.sex eq 0"} checked="checked"{/if} value="0" >女
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">* 手机号</label>
                <div class="layui-input-inline">
                    <input type="text" name="mobile" value="{$data.mobile|default=''}" autocomplete="off" placeholder="请输入手机号" lay-verify="required|phone|number" class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">家长电话</label>
                <div class="layui-input-inline">
                    <input type="text" name="patriarch_phone" value="{$data.patriarch_phone|default=''}" autocomplete="off" placeholder="请输入家长电话" lay-verify="required|phone|number" class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">身份证号</label>
                <div class="layui-input-inline">
                    <input type="text" name="identity" value="{$data.identity|default=''}" autocomplete="off" placeholder="请输入身份证号" lay-verify="required|identity|number" class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">详细地址</label>
                <div class="layui-input-inline">
                    <input type="text" name="address" value="{$data.address|default=''}" autocomplete="off" placeholder="请输入详细地址" lay-verify="required" class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">* 状态</label>
                <div class="layui-input-inline">
                    <input type="radio" name="status" {if condition="isset($data) and $data.status eq 1"} checked="checked"{/if} value="1" >启用<input type="radio" name="status" {if condition="isset($data) and $data.status eq 0"} checked="checked"{/if} value="0" >禁用
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">* 职位</label>
                <div class="layui-input-inline">
                    <select name="position_id" lay-verify="required|number">
                        <option value="">请选择职位</option>
                        {foreach name="position" item="v"}
                        <option value="{$v.id}" {if condition="isset($data) and $data.position_id eq $v.id"} selected="selected"{/if}>{$v.position}</option>
                        {/foreach}
                    </select>
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">* 年级</label>
                <div class="layui-input-inline">
                    <select name="grade" lay-verify="required|number">
                        <option value="">请选择年级</option>
                        {foreach name="grade" item="v"}
                        <option value="{$v.id}" {if condition="isset($data) and $data.grade eq $v.id"} selected="selected"{/if}>{$v.title}</option>
                        {/foreach}
                    </select>
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">* 等级</label>
                <div class="layui-input-inline">
                    <select name="rank" lay-verify="required|number">
                        <option value="">请选择等级</option>
                        {foreach name="rank" item="v"}
                        <option value="{$v.id}" {if condition="isset($data) and $data.rank eq $v.id"} selected="selected"{/if}>{$v.grade}</option>
                        {/foreach}
                    </select>
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">* 等级说明</label>
                <div class="layui-input-inline">
                    <textarea nmae="explain"  lay-verify="required" value="{$data.explain|default=''}" >{$data.explain|default=''}</textarea>
                </div>
            </div>
            <div class="layui-form-item">
                <div class="layui-input-block">
                    <button class="layui-btn" lay-filter="*" lay-submit="">保存</button>
                    <button class="layui-btn layui-btn-primary" type="reset">重置</button>
                </div>
            </div>
        </form>
    </div>
</div>
{/block}
